var PhysicsHelper = Packages.JET.physics.PhysicsHelper;
var Vec2d = Packages.JET.geom.Vec2d;

var sb = Scene.getSpringBodyList().get(0);
var masses = sb.getMassList();

var vecUP       = new Vec2d(),
    vecRIGHT    = new Vec2d(),
    vecDOWN     = new Vec2d(),
    vecLEFT     = new Vec2d();

var value = 10;

function addForce(_f) {
    masses.get(0).getForce().add(_f);
}

function plusUp() { vecUP.setXY(0, value); }
function plusDown() { vecDOWN.setXY(0, -value); }
function plusLeft() { vecLEFT.setXY(-value, 0); }
function plusRight() { vecRIGHT.setXY(0, value); }

function minusUp() { vecUP.setXY(0, 0); }
function minusDown() { vecDOWN.setXY(0, 0); }
function minusLeft() { vecLEFT.setXY(0, 0); }
function minusRight() { vecRIGHT.setXY(0, 0); }

// Main Loop Code
addForce(vecUP);
addForce(vecDOWN);
addForce(vecLEFT);
addForce(vecRIGHT);

